using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace WMS.Infrasturcture.Migrations
{
    /// <summary>
    /// 添加 DataStatus 字段到 Audit 基类
    /// </summary>
    public partial class AddDataStatusField : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            // 为所有继承 Audit 的表添加 DataStatus 字段
            
            migrationBuilder.AddColumn<int>(
                name: "DataStatus",
                table: "StoragelocationInfo",
                type: "int",
                nullable: false,
                defaultValue: 2,
                comment: "数据状态：1草稿 2已提交 3审核中 4已审核");

            migrationBuilder.AddColumn<int>(
                name: "DataStatus",
                table: "WarehouseInfo",
                type: "int",
                nullable: false,
                defaultValue: 2,
                comment: "数据状态：1草稿 2已提交 3审核中 4已审核");

            migrationBuilder.AddColumn<int>(
                name: "DataStatus",
                table: "HandlerInfo",
                type: "int",
                nullable: false,
                defaultValue: 2,
                comment: "数据状态：1草稿 2已提交 3审核中 4已审核");

            migrationBuilder.AddColumn<int>(
                name: "DataStatus",
                table: "InventoryInfo",
                type: "int",
                nullable: false,
                defaultValue: 2,
                comment: "数据状态：1草稿 2已提交 3审核中 4已审核");

            migrationBuilder.AddColumn<int>(
                name: "DataStatus",
                table: "Inventory_check_details",
                type: "int",
                nullable: false,
                defaultValue: 2,
                comment: "数据状态：1草稿 2已提交 3审核中 4已审核");

            migrationBuilder.AddColumn<int>(
                name: "DataStatus",
                table: "ProductInfo",
                type: "int",
                nullable: false,
                defaultValue: 2,
                comment: "数据状态：1草稿 2已提交 3审核中 4已审核");

            migrationBuilder.AddColumn<int>(
                name: "DataStatus",
                table: "StorageWarehouse",
                type: "int",
                nullable: false,
                defaultValue: 2,
                comment: "数据状态：1草稿 2已提交 3审核中 4已审核");

            migrationBuilder.AddColumn<int>(
                name: "DataStatus",
                table: "Uploadattachment",
                type: "int",
                nullable: false,
                defaultValue: 2,
                comment: "数据状态：1草稿 2已提交 3审核中 4已审核");

            migrationBuilder.AddColumn<int>(
                name: "DataStatus",
                table: "WarehouseDept",
                type: "int",
                nullable: false,
                defaultValue: 2,
                comment: "数据状态：1草稿 2已提交 3审核中 4已审核");

            migrationBuilder.AddColumn<int>(
                name: "DataStatus",
                table: "WarehouseSupervisor",
                type: "int",
                nullable: false,
                defaultValue: 2,
                comment: "数据状态：1草稿 2已提交 3审核中 4已审核");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            // 回滚时删除 DataStatus 字段
            
            migrationBuilder.DropColumn(
                name: "DataStatus",
                table: "StoragelocationInfo");

            migrationBuilder.DropColumn(
                name: "DataStatus",
                table: "WarehouseInfo");

            migrationBuilder.DropColumn(
                name: "DataStatus",
                table: "HandlerInfo");

            migrationBuilder.DropColumn(
                name: "DataStatus",
                table: "InventoryInfo");

            migrationBuilder.DropColumn(
                name: "DataStatus",
                table: "Inventory_check_details");

            migrationBuilder.DropColumn(
                name: "DataStatus",
                table: "ProductInfo");

            migrationBuilder.DropColumn(
                name: "DataStatus",
                table: "StorageWarehouse");

            migrationBuilder.DropColumn(
                name: "DataStatus",
                table: "Uploadattachment");

            migrationBuilder.DropColumn(
                name: "DataStatus",
                table: "WarehouseDept");

            migrationBuilder.DropColumn(
                name: "DataStatus",
                table: "WarehouseSupervisor");
        }
    }
}

